<!DOCTYPE HTML>

<html lang="en">
<head>

<title>SecurityMockServerConfigurers (spring-security-docs 5.6.3 API)</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../../../jquery/jquery-ui.css" title="Style">
<script type="text/javascript" src="../../../../../../../script.js"></script>
<script type="text/javascript" src="../../../../../../../jquery/jszip/dist/jszip.min.js"></script>
<script type="text/javascript" src="../../../../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script>
<!--[if IE]>
<script type="text/javascript" src="../../../../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script>
<![endif]-->
<script type="text/javascript" src="../../../../../../../jquery/jquery-3.5.1.js"></script>
<script type="text/javascript" src="../../../../../../../jquery/jquery-ui.js"></script>
</head>
<body>
<script type="text/javascript"><!--
    try {
        if (location.href.indexOf('is-external=true') == -1) {
            parent.document.title="SecurityMockServerConfigurers (spring-security-docs 5.6.3 API)";
        }
    }
    catch(err) {
    }
//-->
var data = {"i0":9,"i1":9,"i2":9,"i3":9,"i4":9,"i5":9,"i6":9,"i7":9,"i8":9,"i9":9,"i10":9,"i11":9};
var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
var pathtoroot = "../../../../../../../";
var useModuleDirectories = true;
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<header role="banner">
<nav role="navigation">
<div class="fixedNav">

<div class="topNav"><a id="navbar.top">

</a>
<div class="skipNav"><a href="SecurityMockServerConfigurers.html#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.top.firstrow">

</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../../allclasses.html">All&nbsp;Classes</a></li>
</ul>
<ul class="navListSearch">
<li><label for="search">SEARCH:</label>
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">
</li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_top");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li><a href="SecurityMockServerConfigurers.html#nested.class.summary">Nested</a>&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="SecurityMockServerConfigurers.html#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="SecurityMockServerConfigurers.html#method.detail">Method</a></li>
</ul>
</div>
<a id="skip.navbar.top">

</a></div>

</div>
<div class="navPadding">&nbsp;</div>
<script type="text/javascript"><!--
$('.navPadding').css('padding-top', $('.fixedNav').css("height"));
//-->
</script>
</nav>
</header>

<main role="main">
<div class="header">
<div class="subTitle"><span class="packageLabelInType">Package</span>&nbsp;<a href="package-summary.html">org.springframework.security.test.web.reactive.server</a></div>
<h2 title="Class SecurityMockServerConfigurers" class="title">Class SecurityMockServerConfigurers</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<pre>public final class <span class="typeNameLabel">SecurityMockServerConfigurers</span>
extends java.lang.Object</pre>
<div class="block">Test utilities for working with Spring Security and
<code>WebTestClient.Builder.apply(WebTestClientConfigurer)</code>.</div>
<dl>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>5.0</dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">

<section role="region">
<ul class="blockList">
<li class="blockList"><a id="nested.class.summary">

</a>
<h3>Nested Class Summary</h3>
<table class="memberSummary">
<caption><span>Nested Classes</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Class</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static class&nbsp;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="SecurityMockServerConfigurers.CsrfMutator.html" title="class in org.springframework.security.test.web.reactive.server">SecurityMockServerConfigurers.CsrfMutator</a></span></code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static class&nbsp;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="SecurityMockServerConfigurers.JwtMutator.html" title="class in org.springframework.security.test.web.reactive.server">SecurityMockServerConfigurers.JwtMutator</a></span></code></th>
<td class="colLast">
<div class="block">Updates the WebServerExchange using <code>{@link
SecurityMockServerConfigurers#mockAuthentication(Authentication)}</code>.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static class&nbsp;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="SecurityMockServerConfigurers.OAuth2ClientMutator.html" title="class in org.springframework.security.test.web.reactive.server">SecurityMockServerConfigurers.OAuth2ClientMutator</a></span></code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static class&nbsp;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="SecurityMockServerConfigurers.OAuth2LoginMutator.html" title="class in org.springframework.security.test.web.reactive.server">SecurityMockServerConfigurers.OAuth2LoginMutator</a></span></code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static class&nbsp;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="SecurityMockServerConfigurers.OidcLoginMutator.html" title="class in org.springframework.security.test.web.reactive.server">SecurityMockServerConfigurers.OidcLoginMutator</a></span></code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static class&nbsp;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="SecurityMockServerConfigurers.OpaqueTokenMutator.html" title="class in org.springframework.security.test.web.reactive.server">SecurityMockServerConfigurers.OpaqueTokenMutator</a></span></code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static class&nbsp;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="SecurityMockServerConfigurers.UserExchangeMutator.html" title="class in org.springframework.security.test.web.reactive.server">SecurityMockServerConfigurers.UserExchangeMutator</a></span></code></th>
<td class="colLast">
<div class="block">Updates the WebServerExchange using <code>{@link
SecurityMockServerConfigurers#mockUser(UserDetails)}</code>.</div>
</td>
</tr>
</table>
</li>
</ul>
</section>

<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.summary">

</a>
<h3>Method Summary</h3>
<table class="memberSummary">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Method</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>static <a href="SecurityMockServerConfigurers.CsrfMutator.html" title="class in org.springframework.security.test.web.reactive.server">SecurityMockServerConfigurers.CsrfMutator</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="SecurityMockServerConfigurers.html#csrf()">csrf</a></span>()</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>static &lt;T extends org.springframework.test.web.reactive.server.WebTestClientConfigurer &amp; org.springframework.test.web.reactive.server.MockServerConfigurer&gt;<br>T</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="SecurityMockServerConfigurers.html#mockAuthentication(org.springframework.security.core.Authentication)">mockAuthentication</a></span>&#8203;(<a href="../../../../core/Authentication.html" title="interface in org.springframework.security.core">Authentication</a>&nbsp;authentication)</code></th>
<td class="colLast">
<div class="block">Updates the ServerWebExchange to use the provided Authentication as the Principal</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>static <a href="SecurityMockServerConfigurers.JwtMutator.html" title="class in org.springframework.security.test.web.reactive.server">SecurityMockServerConfigurers.JwtMutator</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="SecurityMockServerConfigurers.html#mockJwt()">mockJwt</a></span>()</code></th>
<td class="colLast">
<div class="block">Updates the ServerWebExchange to establish a <a href="../../../../core/context/SecurityContext.html" title="interface in org.springframework.security.core.context"><code>SecurityContext</code></a> that has a
<a href="../../../../oauth2/server/resource/authentication/JwtAuthenticationToken.html" title="class in org.springframework.security.oauth2.server.resource.authentication"><code>JwtAuthenticationToken</code></a> for the <a href="../../../../core/Authentication.html" title="interface in org.springframework.security.core"><code>Authentication</code></a> and a <a href="../../../../oauth2/jwt/Jwt.html" title="class in org.springframework.security.oauth2.jwt"><code>Jwt</code></a> for
the <a href="../../../../core/Authentication.html#getPrincipal()"><code>Authentication.getPrincipal()</code></a>.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>static <a href="SecurityMockServerConfigurers.OAuth2ClientMutator.html" title="class in org.springframework.security.test.web.reactive.server">SecurityMockServerConfigurers.OAuth2ClientMutator</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="SecurityMockServerConfigurers.html#mockOAuth2Client()">mockOAuth2Client</a></span>()</code></th>
<td class="colLast">
<div class="block">Updates the ServerWebExchange to establish a <a href="../../../../oauth2/client/OAuth2AuthorizedClient.html" title="class in org.springframework.security.oauth2.client"><code>OAuth2AuthorizedClient</code></a> in the
session.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>static <a href="SecurityMockServerConfigurers.OAuth2ClientMutator.html" title="class in org.springframework.security.test.web.reactive.server">SecurityMockServerConfigurers.OAuth2ClientMutator</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="SecurityMockServerConfigurers.html#mockOAuth2Client(java.lang.String)">mockOAuth2Client</a></span>&#8203;(java.lang.String&nbsp;registrationId)</code></th>
<td class="colLast">
<div class="block">Updates the ServerWebExchange to establish a <a href="../../../../oauth2/client/OAuth2AuthorizedClient.html" title="class in org.springframework.security.oauth2.client"><code>OAuth2AuthorizedClient</code></a> in the
session.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>static <a href="SecurityMockServerConfigurers.OAuth2LoginMutator.html" title="class in org.springframework.security.test.web.reactive.server">SecurityMockServerConfigurers.OAuth2LoginMutator</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="SecurityMockServerConfigurers.html#mockOAuth2Login()">mockOAuth2Login</a></span>()</code></th>
<td class="colLast">
<div class="block">Updates the ServerWebExchange to establish a <a href="../../../../core/context/SecurityContext.html" title="interface in org.springframework.security.core.context"><code>SecurityContext</code></a> that has a
<a href="../../../../oauth2/client/authentication/OAuth2AuthenticationToken.html" title="class in org.springframework.security.oauth2.client.authentication"><code>OAuth2AuthenticationToken</code></a> for the <a href="../../../../core/Authentication.html" title="interface in org.springframework.security.core"><code>Authentication</code></a>.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>static <a href="SecurityMockServerConfigurers.OidcLoginMutator.html" title="class in org.springframework.security.test.web.reactive.server">SecurityMockServerConfigurers.OidcLoginMutator</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="SecurityMockServerConfigurers.html#mockOidcLogin()">mockOidcLogin</a></span>()</code></th>
<td class="colLast">
<div class="block">Updates the ServerWebExchange to establish a <a href="../../../../core/context/SecurityContext.html" title="interface in org.springframework.security.core.context"><code>SecurityContext</code></a> that has a
<a href="../../../../oauth2/client/authentication/OAuth2AuthenticationToken.html" title="class in org.springframework.security.oauth2.client.authentication"><code>OAuth2AuthenticationToken</code></a> for the <a href="../../../../core/Authentication.html" title="interface in org.springframework.security.core"><code>Authentication</code></a>.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>static <a href="SecurityMockServerConfigurers.OpaqueTokenMutator.html" title="class in org.springframework.security.test.web.reactive.server">SecurityMockServerConfigurers.OpaqueTokenMutator</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="SecurityMockServerConfigurers.html#mockOpaqueToken()">mockOpaqueToken</a></span>()</code></th>
<td class="colLast">
<div class="block">Updates the ServerWebExchange to establish a <a href="../../../../core/context/SecurityContext.html" title="interface in org.springframework.security.core.context"><code>SecurityContext</code></a> that has a
<a href="../../../../oauth2/server/resource/authentication/BearerTokenAuthentication.html" title="class in org.springframework.security.oauth2.server.resource.authentication"><code>BearerTokenAuthentication</code></a> for the <a href="../../../../core/Authentication.html" title="interface in org.springframework.security.core"><code>Authentication</code></a> and an
<a href="../../../../oauth2/core/OAuth2AuthenticatedPrincipal.html" title="interface in org.springframework.security.oauth2.core"><code>OAuth2AuthenticatedPrincipal</code></a> for the <a href="../../../../core/Authentication.html#getPrincipal()"><code>Authentication.getPrincipal()</code></a>.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>static <a href="SecurityMockServerConfigurers.UserExchangeMutator.html" title="class in org.springframework.security.test.web.reactive.server">SecurityMockServerConfigurers.UserExchangeMutator</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="SecurityMockServerConfigurers.html#mockUser()">mockUser</a></span>()</code></th>
<td class="colLast">
<div class="block">Updates the ServerWebExchange to use a UserDetails to create a
UsernamePasswordAuthenticationToken as the Principal.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>static <a href="SecurityMockServerConfigurers.UserExchangeMutator.html" title="class in org.springframework.security.test.web.reactive.server">SecurityMockServerConfigurers.UserExchangeMutator</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="SecurityMockServerConfigurers.html#mockUser(java.lang.String)">mockUser</a></span>&#8203;(java.lang.String&nbsp;username)</code></th>
<td class="colLast">
<div class="block">Updates the ServerWebExchange to use a UserDetails to create a
UsernamePasswordAuthenticationToken as the Principal.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>static &lt;T extends org.springframework.test.web.reactive.server.WebTestClientConfigurer &amp; org.springframework.test.web.reactive.server.MockServerConfigurer&gt;<br>T</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="SecurityMockServerConfigurers.html#mockUser(org.springframework.security.core.userdetails.UserDetails)">mockUser</a></span>&#8203;(<a href="../../../../core/userdetails/UserDetails.html" title="interface in org.springframework.security.core.userdetails">UserDetails</a>&nbsp;userDetails)</code></th>
<td class="colLast">
<div class="block">Updates the ServerWebExchange to use the provided UserDetails to create a
UsernamePasswordAuthenticationToken as the Principal</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code>static org.springframework.test.web.reactive.server.MockServerConfigurer</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="SecurityMockServerConfigurers.html#springSecurity()">springSecurity</a></span>()</code></th>
<td class="colLast">
<div class="block">Sets up Spring Security's <code>WebTestClient</code> test support</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a id="methods.inherited.from.class.java.lang.Object">

</a>
<h3>Methods inherited from class&nbsp;java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">

<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.detail">

</a>
<h3>Method Detail</h3>
<a id="springSecurity()">

</a>
<ul class="blockList">
<li class="blockList">
<h4>springSecurity</h4>
<pre class="methodSignature">public static&nbsp;org.springframework.test.web.reactive.server.MockServerConfigurer&nbsp;springSecurity()</pre>
<div class="block">Sets up Spring Security's <code>WebTestClient</code> test support</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the MockServerConfigurer to use</dd>
</dl>
</li>
</ul>
<a id="mockAuthentication(org.springframework.security.core.Authentication)">

</a>
<ul class="blockList">
<li class="blockList">
<h4>mockAuthentication</h4>
<pre class="methodSignature">public static&nbsp;&lt;T extends org.springframework.test.web.reactive.server.WebTestClientConfigurer &amp; org.springframework.test.web.reactive.server.MockServerConfigurer&gt;&nbsp;T&nbsp;mockAuthentication&#8203;(<a href="../../../../core/Authentication.html" title="interface in org.springframework.security.core">Authentication</a>&nbsp;authentication)</pre>
<div class="block">Updates the ServerWebExchange to use the provided Authentication as the Principal</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>authentication</code> - the Authentication to use.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the configurer to use</dd>
</dl>
</li>
</ul>
<a id="mockUser(org.springframework.security.core.userdetails.UserDetails)">

</a>
<ul class="blockList">
<li class="blockList">
<h4>mockUser</h4>
<pre class="methodSignature">public static&nbsp;&lt;T extends org.springframework.test.web.reactive.server.WebTestClientConfigurer &amp; org.springframework.test.web.reactive.server.MockServerConfigurer&gt;&nbsp;T&nbsp;mockUser&#8203;(<a href="../../../../core/userdetails/UserDetails.html" title="interface in org.springframework.security.core.userdetails">UserDetails</a>&nbsp;userDetails)</pre>
<div class="block">Updates the ServerWebExchange to use the provided UserDetails to create a
UsernamePasswordAuthenticationToken as the Principal</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>userDetails</code> - the UserDetails to use.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the configurer to use</dd>
</dl>
</li>
</ul>
<a id="mockUser()">

</a>
<ul class="blockList">
<li class="blockList">
<h4>mockUser</h4>
<pre class="methodSignature">public static&nbsp;<a href="SecurityMockServerConfigurers.UserExchangeMutator.html" title="class in org.springframework.security.test.web.reactive.server">SecurityMockServerConfigurers.UserExchangeMutator</a>&nbsp;mockUser()</pre>
<div class="block">Updates the ServerWebExchange to use a UserDetails to create a
UsernamePasswordAuthenticationToken as the Principal. This uses a default username
of "user", password of "password", and granted authorities of "ROLE_USER".</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the <a href="SecurityMockServerConfigurers.UserExchangeMutator.html" title="class in org.springframework.security.test.web.reactive.server"><code>SecurityMockServerConfigurers.UserExchangeMutator</code></a> to use</dd>
</dl>
</li>
</ul>
<a id="mockUser(java.lang.String)">

</a>
<ul class="blockList">
<li class="blockList">
<h4>mockUser</h4>
<pre class="methodSignature">public static&nbsp;<a href="SecurityMockServerConfigurers.UserExchangeMutator.html" title="class in org.springframework.security.test.web.reactive.server">SecurityMockServerConfigurers.UserExchangeMutator</a>&nbsp;mockUser&#8203;(java.lang.String&nbsp;username)</pre>
<div class="block">Updates the ServerWebExchange to use a UserDetails to create a
UsernamePasswordAuthenticationToken as the Principal. This uses a default password
of "password" and granted authorities of "ROLE_USER".</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the <code>WebTestClientConfigurer</code> to use</dd>
</dl>
</li>
</ul>
<a id="mockJwt()">

</a>
<ul class="blockList">
<li class="blockList">
<h4>mockJwt</h4>
<pre class="methodSignature">public static&nbsp;<a href="SecurityMockServerConfigurers.JwtMutator.html" title="class in org.springframework.security.test.web.reactive.server">SecurityMockServerConfigurers.JwtMutator</a>&nbsp;mockJwt()</pre>
<div class="block">Updates the ServerWebExchange to establish a <a href="../../../../core/context/SecurityContext.html" title="interface in org.springframework.security.core.context"><code>SecurityContext</code></a> that has a
<a href="../../../../oauth2/server/resource/authentication/JwtAuthenticationToken.html" title="class in org.springframework.security.oauth2.server.resource.authentication"><code>JwtAuthenticationToken</code></a> for the <a href="../../../../core/Authentication.html" title="interface in org.springframework.security.core"><code>Authentication</code></a> and a <a href="../../../../oauth2/jwt/Jwt.html" title="class in org.springframework.security.oauth2.jwt"><code>Jwt</code></a> for
the <a href="../../../../core/Authentication.html#getPrincipal()"><code>Authentication.getPrincipal()</code></a>. All details are declarative and do not
require the JWT to be valid.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the <a href="SecurityMockServerConfigurers.JwtMutator.html" title="class in org.springframework.security.test.web.reactive.server"><code>SecurityMockServerConfigurers.JwtMutator</code></a> to further configure or use</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>5.2</dd>
</dl>
</li>
</ul>
<a id="mockOpaqueToken()">

</a>
<ul class="blockList">
<li class="blockList">
<h4>mockOpaqueToken</h4>
<pre class="methodSignature">public static&nbsp;<a href="SecurityMockServerConfigurers.OpaqueTokenMutator.html" title="class in org.springframework.security.test.web.reactive.server">SecurityMockServerConfigurers.OpaqueTokenMutator</a>&nbsp;mockOpaqueToken()</pre>
<div class="block">Updates the ServerWebExchange to establish a <a href="../../../../core/context/SecurityContext.html" title="interface in org.springframework.security.core.context"><code>SecurityContext</code></a> that has a
<a href="../../../../oauth2/server/resource/authentication/BearerTokenAuthentication.html" title="class in org.springframework.security.oauth2.server.resource.authentication"><code>BearerTokenAuthentication</code></a> for the <a href="../../../../core/Authentication.html" title="interface in org.springframework.security.core"><code>Authentication</code></a> and an
<a href="../../../../oauth2/core/OAuth2AuthenticatedPrincipal.html" title="interface in org.springframework.security.oauth2.core"><code>OAuth2AuthenticatedPrincipal</code></a> for the <a href="../../../../core/Authentication.html#getPrincipal()"><code>Authentication.getPrincipal()</code></a>.
All details are declarative and do not require the token to be valid.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the <a href="SecurityMockServerConfigurers.OpaqueTokenMutator.html" title="class in org.springframework.security.test.web.reactive.server"><code>SecurityMockServerConfigurers.OpaqueTokenMutator</code></a> to further configure or use</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>5.3</dd>
</dl>
</li>
</ul>
<a id="mockOAuth2Login()">

</a>
<ul class="blockList">
<li class="blockList">
<h4>mockOAuth2Login</h4>
<pre class="methodSignature">public static&nbsp;<a href="SecurityMockServerConfigurers.OAuth2LoginMutator.html" title="class in org.springframework.security.test.web.reactive.server">SecurityMockServerConfigurers.OAuth2LoginMutator</a>&nbsp;mockOAuth2Login()</pre>
<div class="block">Updates the ServerWebExchange to establish a <a href="../../../../core/context/SecurityContext.html" title="interface in org.springframework.security.core.context"><code>SecurityContext</code></a> that has a
<a href="../../../../oauth2/client/authentication/OAuth2AuthenticationToken.html" title="class in org.springframework.security.oauth2.client.authentication"><code>OAuth2AuthenticationToken</code></a> for the <a href="../../../../core/Authentication.html" title="interface in org.springframework.security.core"><code>Authentication</code></a>. All details are
declarative and do not require the corresponding OAuth 2.0 tokens to be valid.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the <a href="SecurityMockServerConfigurers.OAuth2LoginMutator.html" title="class in org.springframework.security.test.web.reactive.server"><code>SecurityMockServerConfigurers.OAuth2LoginMutator</code></a> to further configure or use</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>5.3</dd>
</dl>
</li>
</ul>
<a id="mockOidcLogin()">

</a>
<ul class="blockList">
<li class="blockList">
<h4>mockOidcLogin</h4>
<pre class="methodSignature">public static&nbsp;<a href="SecurityMockServerConfigurers.OidcLoginMutator.html" title="class in org.springframework.security.test.web.reactive.server">SecurityMockServerConfigurers.OidcLoginMutator</a>&nbsp;mockOidcLogin()</pre>
<div class="block">Updates the ServerWebExchange to establish a <a href="../../../../core/context/SecurityContext.html" title="interface in org.springframework.security.core.context"><code>SecurityContext</code></a> that has a
<a href="../../../../oauth2/client/authentication/OAuth2AuthenticationToken.html" title="class in org.springframework.security.oauth2.client.authentication"><code>OAuth2AuthenticationToken</code></a> for the <a href="../../../../core/Authentication.html" title="interface in org.springframework.security.core"><code>Authentication</code></a>. All details are
declarative and do not require the corresponding OAuth 2.0 tokens to be valid.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the <a href="SecurityMockServerConfigurers.OidcLoginMutator.html" title="class in org.springframework.security.test.web.reactive.server"><code>SecurityMockServerConfigurers.OidcLoginMutator</code></a> to further configure or use</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>5.3</dd>
</dl>
</li>
</ul>
<a id="mockOAuth2Client()">

</a>
<ul class="blockList">
<li class="blockList">
<h4>mockOAuth2Client</h4>
<pre class="methodSignature">public static&nbsp;<a href="SecurityMockServerConfigurers.OAuth2ClientMutator.html" title="class in org.springframework.security.test.web.reactive.server">SecurityMockServerConfigurers.OAuth2ClientMutator</a>&nbsp;mockOAuth2Client()</pre>
<div class="block">Updates the ServerWebExchange to establish a <a href="../../../../oauth2/client/OAuth2AuthorizedClient.html" title="class in org.springframework.security.oauth2.client"><code>OAuth2AuthorizedClient</code></a> in the
session. All details are declarative and do not require the corresponding OAuth 2.0
tokens to be valid.
<p>
The support works by associating the authorized client to the ServerWebExchange via
the <a href="../../../../oauth2/client/web/server/WebSessionServerOAuth2AuthorizedClientRepository.html" title="class in org.springframework.security.oauth2.client.web.server"><code>WebSessionServerOAuth2AuthorizedClientRepository</code></a>
</p></div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the <a href="SecurityMockServerConfigurers.OAuth2ClientMutator.html" title="class in org.springframework.security.test.web.reactive.server"><code>SecurityMockServerConfigurers.OAuth2ClientMutator</code></a> to further configure or use</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>5.3</dd>
</dl>
</li>
</ul>
<a id="mockOAuth2Client(java.lang.String)">

</a>
<ul class="blockList">
<li class="blockList">
<h4>mockOAuth2Client</h4>
<pre class="methodSignature">public static&nbsp;<a href="SecurityMockServerConfigurers.OAuth2ClientMutator.html" title="class in org.springframework.security.test.web.reactive.server">SecurityMockServerConfigurers.OAuth2ClientMutator</a>&nbsp;mockOAuth2Client&#8203;(java.lang.String&nbsp;registrationId)</pre>
<div class="block">Updates the ServerWebExchange to establish a <a href="../../../../oauth2/client/OAuth2AuthorizedClient.html" title="class in org.springframework.security.oauth2.client"><code>OAuth2AuthorizedClient</code></a> in the
session. All details are declarative and do not require the corresponding OAuth 2.0
tokens to be valid.
<p>
The support works by associating the authorized client to the ServerWebExchange via
the <a href="../../../../oauth2/client/web/server/WebSessionServerOAuth2AuthorizedClientRepository.html" title="class in org.springframework.security.oauth2.client.web.server"><code>WebSessionServerOAuth2AuthorizedClientRepository</code></a>
</p></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>registrationId</code> - The registration id associated with the
<a href="../../../../oauth2/client/OAuth2AuthorizedClient.html" title="class in org.springframework.security.oauth2.client"><code>OAuth2AuthorizedClient</code></a></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the <a href="SecurityMockServerConfigurers.OAuth2ClientMutator.html" title="class in org.springframework.security.test.web.reactive.server"><code>SecurityMockServerConfigurers.OAuth2ClientMutator</code></a> to further configure or use</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>5.3</dd>
</dl>
</li>
</ul>
<a id="csrf()">

</a>
<ul class="blockListLast">
<li class="blockList">
<h4>csrf</h4>
<pre class="methodSignature">public static&nbsp;<a href="SecurityMockServerConfigurers.CsrfMutator.html" title="class in org.springframework.security.test.web.reactive.server">SecurityMockServerConfigurers.CsrfMutator</a>&nbsp;csrf()</pre>
</li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
</div>
</main>

<footer role="contentinfo">
<nav role="navigation">

<div class="bottomNav"><a id="navbar.bottom">

</a>
<div class="skipNav"><a href="SecurityMockServerConfigurers.html#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.bottom.firstrow">

</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../../allclasses.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_bottom");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li><a href="SecurityMockServerConfigurers.html#nested.class.summary">Nested</a>&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="SecurityMockServerConfigurers.html#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="SecurityMockServerConfigurers.html#method.detail">Method</a></li>
</ul>
</div>
<a id="skip.navbar.bottom">

</a></div>

</nav>
</footer>
<script>if (window.parent == window) {(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','//www.google-analytics.com/analytics.js','ga');ga('create', 'UA-2728886-23', 'auto', {'siteSpeedSampleRate': 100});ga('send', 'pageview');}</script><script defer src="https://static.cloudflareinsights.com/beacon.min.js/v652eace1692a40cfa3763df669d7439c1639079717194" integrity="sha512-Gi7xpJR8tSkrpF7aordPZQlW2DLtzUlZcumS8dMQjwDHEnw9I7ZLyiOj/6tZStRBGtGgN6ceN6cMH8z7etPGlw==" data-cf-beacon='{"rayId":"7040ee97788297cf","token":"bffcb8a918ae4755926f76178bfbd26b","version":"2021.12.0","si":100}' crossorigin="anonymous"></script>
</body>
</html>
